<?php
/**
 * @version		$Id: view.html.php 2011.08.11 thierry $
 * @package		admin.views.graphics
 * @subpackage	com_projid
 * @copyright	Copyright (C) 2011 Pojid All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class ProjidViewGraphics extends JView
	{
		function display($tpl = null) 
			{
	// Get data from the model
				$items = $this->get('Items');
				$pagination = $this->get('Pagination');
			
		 
	// Check for errors.
				if (count($errors = $this->get('Errors'))) 
					{
						JError::raiseError(500, implode('<br />', $errors));
						return false;
					}
	// Assign data to the view
				$this->items = $items;
				$this->pagination = $pagination;
		 		
	// Set the toolbar
				$this->addToolBar();
		 
	// Display the template
				parent::display($tpl);
	// Set the document
				$this->setDocument();
	}
 //TOOLBAR
	protected function addToolBar() 
	{
		JToolBarHelper::title(JText::_('COM_PROJID_MANAGER_GRAPHIC'),'graphic');
		JToolBarHelper::deleteListX('', 'graphics.delete');
		JToolBarHelper::editListX('graphic.edit');
		JToolBarHelper::addNewX('graphic.add');
		//JToolBarHelper::preview('index.php?option=com_projid&view=single&format=raw');
	}
/**PROPERTIES**/
	protected function setDocument() 
	{
		$document = JFactory::getDocument();
		$document->setTitle(JText::_('COM_PROJID_ADMINISTRATION'));
	}
}
